package sd.settemmezzo.util;

public class Lock {
	
	int timeout;
	
	public Lock() {
		this.timeout = 0;
	}
	
	public Lock(int timeout) {
		this.timeout = timeout;
	}
	
	public synchronized void lock() {
		try {
			wait(timeout);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
	public synchronized void unlock() {
		notify();
	}
}
